package Ep03_HashTable._0242;

/**
 * @author Jimmy Zhan WORKSTATION
 * @date 2023/3/10 15:50
 * 说明： 力扣 0242 有效的字母异位词
 */

public class Mine {
    public boolean isAnagram(String s, String t) {
        int[] alphaBet = new int[26];
        for (int i = 0; i < s.length(); i++) {
            alphaBet[s.charAt(i)-'a']++;
        }
        for (int i = 0; i < t.length(); i++) {
            alphaBet[t.charAt(i)-'a']--;
        }
        for (int i = 0; i < 26; i++) {
            if (alphaBet[i] != 0){
                return false;
            }
        }
        return true;
    }
}
